package com.smart.lx.decorator;

/**
 * 功能描述: <br>
 * 〈加鸡蛋煎饼〉
 *
 * @since: 1.0.0
 * @Author:abc
 * @Date: 2019/4/6
 */
public class AddEggJianbing extends IJianbing {

    private double price = 2;
    private String own = "加一个鸡蛋";



    IJianbing jb;
    public AddEggJianbing(IJianbing jb) {
        this.jb = jb;
    }

    public IJianbing create(){
        System.out.println("加一个鸡蛋");
        setPrice(jb.getPrice() + price);
        setOwn(jb.getOwn() + own);
        System.out.println("价格: " + price);
        return this;
    }

    @Override
    public double getPrice() {
        return price;
    }

    @Override
    public void setPrice(double price) {
        this.price = price;
    }

    @Override
    public String getOwn() {
        return own;
    }

    @Override
    public void setOwn(String own) {
        this.own = own;
    }
}
